import request from '@/utils/request'

// 查询商品类型管理列表
export function listCommodityType(query) {
  return request({
    url: '/shopping/CommodityType/list',
    method: 'get',
    params: query
  })
}

// 查询商品类型管理详细
export function getCommodityType(id) {
  return request({
    url: '/shopping/CommodityType/' + id,
    method: 'get'
  })
}

// 新增商品类型管理
export function addCommodityType(data) {
  return request({
    url: '/shopping/CommodityType',
    method: 'post',
    data: data
  })
}
// 批量新增商品类型管理
export function addType(data) {
  return request({
    url: '/shopping/CommodityType/batch',
    method: 'post',
    data: data
  })
}
export function add(data) {
  return request({
    url: '/shopping/CommodityType/update',
    method: 'post',
    data: data
  })
}


// 修改商品类型管理
export function updateCommodityType(data) {
  return request({
    url: '/shopping/CommodityType',
    method: 'put',
    data: data
  })
}
export function clearCommodityType(id) {
  return request({
    url: '/shopping/CommodityType/clear/'+id,
    method: 'put'
  })
}

// 删除商品类型管理
export function delCommodityType(id) {
  return request({
    url: '/shopping/CommodityType/' + id,
    method: 'delete'
  })
}

